//! Header for the MusicMedia class
#ifndef MUSICMEDIA_H
#define MUSICMEDIA_H

#include <string>
#include "Object.h"

class IVisitor;

//! An Enumeration which lists the different Kinds of MusicMedia
enum TMediaKind {
	eSong, eAlbum, eMusicCollection
};

//! A Struct which can store a duration of a song.
struct TDuration {
   //! The number of minutes a song endures. (May be more than 59)
	size_t Minutes;
   
   //! The seconds a song lasts. (If used correctly, never more than 59);
	size_t Seconds;
};

//! Represents MusicMedia. 
/*!
	MusicMedia is the abstract component in terms of design patterns (composite pattern)
	and also acts as the visitable abstract element (visitor pattern).
	\class MusicMedia
	\author Thomas Pfeiffer
	\date 06.12.2012
*/
class MusicMedia : public Object {
public:
	
	//! The CTor of a Musicmedia
	/*!
		Sets the kind of the created musicmedia.
		\param k The Kind of the Musicmedia
		\param name The name of the Musicmedia
	*/
	MusicMedia(TMediaKind k, std::string name) : mKind(k), mName(name) {}

	//! Used to add a MusicMedia to the composite structure.
	/*!
		Adds MusicMedia to the composite structure. Doesn't check
		the Kind of the Musicmedia.
		\param mm The MusicMedia want to add. Must only be a Song.
		\throws std::exception if mm is null or if it's called of the base class (MusicMedia)
	*/
	virtual void Add (MusicMedia * mm);
	
	//! Visits the Visitor visitor.
	/*!
	Calls visit of the concrete Visitor visitor
	\param visitor A Pointer to the concrete Visitor that should be visited.
	*/
	virtual void Accept (IVisitor * visitor) = 0;

	//! Returns the Name of the MusicMedia
	/*!
	This function returns the MusicMedia's name
	\returns The MusicMedia's name.
	*/
	std::string const * getName() const;
	
	//! Returns the kind of the Media
	/*!
		\returns The kind of the media
	*/
	TMediaKind getKind() const;

protected:
   //! Specifies the name of the MusicMedia
	std::string mName;
   
   //! Specifies the Kind of the MusicMedia
	TMediaKind mKind;
};

#endif